# @Time    : 2022/1/11 19:29
# @Author  : 南黎
# @FileName: 3.1新建csv.py
import csv

with open('3.1新建csv.csv', 'w', newline='') as csvfile:
    writer = csv.writer(csvfile)
    writer.writerow(['xuehao', 'name', 'age'])
    # 写入多行
    data = [('123456', '甲', '21'), ('123457', '乙', '31')]
    writer.writerows(data)